package com.hnichr.ump.common.assessment.entity;

import com.fasterxml.jackson.annotation.JsonFormat;
import com.hnichr.ump.common.entity.UmpEntity;
import com.mxpioframework.jpa.annotation.Generator;
import com.mxpioframework.security.annotation.Dict;
import io.swagger.v3.oas.annotations.media.Schema;
import lombok.Data;
import lombok.EqualsAndHashCode;

import javax.persistence.*;
import java.util.Date;


@Data
@EqualsAndHashCode(callSuper=false)
@Entity
@Table(name = "t_assessment_testee",uniqueConstraints=@UniqueConstraint(columnNames={"EMAIL_","TENANT_ID_"}))
@Schema(description = "受测者信息")
public class Testee extends UmpEntity {
    @Id
    @Generator
    @Column(name = "ID_", updatable = false)
    @Schema(description = "ID")
    private String id ;

    @Column(name = "NAME_")
    @Schema(description = "姓名")
    private String name ;

    @Column(name = "GENDER_")
    @Schema(description = "性别")
    @Dict(dicCode="SEX")
    private String gender ;

    @Column(name = "BIRTHDAY_")
    @Schema(description = "出生日期")
    @JsonFormat(pattern = "yyyy-MM-dd", timezone = "GMT+8")
    private Date birthday ;

    @Column(name = "GRADUATION_DATE_")
    @Schema(description = "毕业时间")
    @JsonFormat(pattern = "yyyy-MM-dd", timezone = "GMT+8")
    private Date graduationDate;

    @Column(name = "GRADUATION_SCHOOL_")
    @Schema(description = "毕业院校")
    private String graduationSchool;

    @Column(name = "MAJOR_")
    @Schema(description = "专业")
    private String major;

    @Column(name = "MOBILE_")
    @Schema(description = "手机号")
    private String mobile;

    @Column(name = "EMAIL_", updatable = false)
    @Schema(description = "邮箱")
    private String email;

    @Column(name = "TENANT_ID_")
    @Schema(description = "租户")
    @Dict(dicCode = "BEISEN_ACTIVITY_TENANT")
    private String tenantId;

}
